package com.jiang.demo2.bean;

import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
public class Result<T> {

    private int code;

    private String message;

    private T data;

    public static <T> Result succuse(T data){
        Result<T> result = new Result();
        result.code = 0;
        result.message="成功";
        result.data =  data;

        return result;
    }

    public static <T> Result fail(int code ,String msg){
        Result<T> result = new Result();
        result.code = code;
        result.message=msg;
        result.data =  null;

        return result;
    }
}
